package com.three.service;

import com.three.DAO.impl.ConsumInfoDAOImpl;
import com.three.entity.ConsumInfo;
import com.three.entity.MobileCard;
import com.three.entity.Scene;

public class AddconsumInfo {
	ConsumInfo con=new ConsumInfo();
	ConsumInfoDAOImpl cioi=new ConsumInfoDAOImpl();
	public void AddConsumInfo(Scene sc,MobileCard  mobilecard) {
	 switch(sc.getType()) {
	 	case "talktime":con.setTalkTime(sc.getData());break;
	 	case "smscount": con.setSmsCount(sc.getData());break;
	 	case "flow":con.setFlow(sc.getData());
	 }
	 con.setPrice(sc.getPrice());
	 con.setCardnumber(mobilecard.getCardNumber());
	 cioi.addConsumInfo(con);
	 

	}

}
